package com.hunan.api.catv.entity.enums;

/**
 * 资讯状态
 */
public enum NewsState {

    cancel(0, "失效"),
    effective(1, "有效"),
    examine(2, "审核中");

    private final Integer code;

    private final String msg;

    NewsState(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public static NewsState getResult(int code) {
        NewsState[] rcs = NewsState.values();
        for (NewsState rc : rcs) {
            if (rc.getCode().equals(code)) {
                return rc;
            }
        }
        return null;
    }
}
